partial class RO_MULTIMAP_INCL{K,E} |
---|
**** | Partial class for multi-maps |
COMPARE{_} |
MULTIMAP_INCL{_,_} | H_MULTIMAP{_,_} | MULTIMAP{_,_} |
elt_eq(e1,e2:ETP):BOOL .. Included as elt_eq |
---|
**** | The "less than" relation used in the sorting routines. Compares the object "id" by default. May be redefined in descendants. |
elt_hash(e:ETP):INT .. Included as elt_hash |
---|
**** | A hash value associated with an element. Must have the property that if "elt_eq(e1,e2)" then "elt_hash(e1)=elt_hash(e2)". Can be defined to always return 0, but many routines will then become quadratic. Uses object "id" by default. May be redefined in descendants. |
elt_if(test:ROUT{E}:BOOL,out res:E):BOOL |
---|
**** | Return the first element that satisfies "test" in "res" Return true if a element was found, false otherwise |
elt_lt(e1,e2:ETP):BOOL .. Included as elt_lt |
---|
**** | The "less than" relation used in the sorting routines. Compares the object "id" by default. May be redefined in descendants. |
elt_nil: ETP .. Included as elt_nil |
---|
**** | Return the nil value. If the element is under $NIL then return e.nil. Otherwise, return void
_ |
equals(b: $RO_MULTIMAP{K,E}): BOOL |
---|
**** | Returns true if all of "e"'s elements are equal to self's elts Ordering is an issue. Should be redefined to be more precise for particular descendants |
has(e: E): BOOL |
---|
**** | Return true if this multimap has the element "e" |
has_elt(e: E): BOOL |
---|
has_ind(k: K): BOOL |
---|
**** | Return true if the index "k" has at least one target in this multimap |
ind_if(test:ROUT{E}:BOOL):K |
---|
**** | Return the index of the leftmost element that satisfies `test', or void if there is none. Must be changed to use an out argument |
inds: ARRAY{K} |
---|
**** | Return an index array which is the same size as self and is set to the values of the indices |
is_elt_nil(e:ETP):BOOL .. Included as is_elt_nil |
---|
stub n_inds: INT; |
---|
**** | Return the total number of indices |
stub n_targets(k:K): INT; |
---|
**** | Return the number of targets for index "k" |
stub size: INT; |
---|
**** | The number of elements in this multimap |
str: STR |
---|
**** | Prints out a string version of the array of the components that are under $STR, and their associated indices |
str_of_elts: STR |
---|
**** | Prints out a string version of the array of the components that are under $STR, and their associated indices |
targets(k: K): BAG{E} |
---|
stub elt!: E; |
---|
**** | Yield elements (unordered) |
filter!(once f:ROUT{E}:BOOL): E |
---|
**** | Yield all elements that satisfy the boolean predicate "f" |
filter_not!(once f:ROUT{E}:BOOL): E |
---|
**** | Yield all elements that do not satisfy the boolean predicate "f" |
stub ind!: K; |
---|
**** | Yield element indices (unordered) |
stub pair!: TUP{K,E}; |
---|
**** | Yield pairs of index,element |
stub target!(once k:K): E; |
---|
**** | Yield the targets of the index "k" |
target!: E |
---|
elt_str(e: E): STR |
---|
ind_str(i: K): STR |
---|